#include "../include/Room.hh"
#include "../include/color.hh"
Room::Room() : id(0), type(RoomType::START), visited(false), neighbors() {}

Room::Room(int id, RoomType type)
    : id(id), type(type), visited(false), neighbors() {}

Room::Room(Room&& other) noexcept
    : id(other.id),
      type(other.type),
      visited(other.visited),
      neighbors(std::move(other.neighbors)) {
    other.id = 0;
    other.type = RoomType::START;
    other.visited = false;
}

Room& Room::operator=(Room&& other) noexcept {
    if (this != &other) {
        id = other.id;
        type = other.type;
        visited = other.visited;
        neighbors = std::move(other.neighbors);
        other.id = 0;
        other.type = RoomType::START;
        other.visited = false;
    }
    return *this;
}

std::string Room::getTypeName() const {
    if (visited && type != RoomType::REWARD) {
        return COLOR_GRAY "Room already visited" COLOR_RESET;
    }
    switch (type) {
        case RoomType::START: return "Start";
        case RoomType::ENEMY: return COLOR_RED "Enemy Room" COLOR_RESET;
        case RoomType::REWARD: return COLOR_YELLOW "Shop" COLOR_RESET;
        case RoomType::BOSS: return COLOR_MAGENTA "Boss Room" COLOR_RESET;
        default: return "Unknown";
    }
}